/*=====================================================================================================================
                    Copyright(c) 2009 Geometric PLM Software Corp. All rights reserved.
                             Unpublished - All rights reserved
=======================================================================================================================
File description:
    Filename: tc_utils.h
    Module  : Common module.

        This file includes the operations of extended utilities.

=======================================================================================================================
Date               Name              Description of Change
14-Jul-2009        Penn,Xie          Initialize creation
$HISTORY$
=====================================================================================================================*/
#ifndef TC_UTILS_H
#define TC_UTILS_H
#include <stdio.h>
#include <stdlib.h>

#include <unidefs.h>
#include "vector_c.h"

#ifdef __cplusplus
    extern "C"
    {
#endif
    /**
    * Whether exists the text in text list.
    * @param text     - <I> text object
    * @param textList - <I> incremental growth rate when needed
    * @return - true or false
    */
    extern logical GUTIL_exist_str( const char *text, const Vector_t *textList );

    /**
    * Whether exists the tag in tag list.
    * @param tag     - <I> tag object
    * @param tagList - <I> incremental growth rate when needed
    * @return - true or false
    */
    extern logical GUTIL_exist_tag( tag_t tag, const Vector_t *tagList );

    /**
    * Whether some text in text list is the begin text.
    * @param text     - <I> text object
    * @param textList - <I> incremental growth rate when needed
    * @return - true or false
    */
    extern logical GUTIL_is_begin_strs( const char *text, const Vector_t *textList );

    /**
    * Whether b_str is the begin of text.
    * @param text  - <I> text object
    * @param b_str - <I> begin string
    * @param iscase - <I> case: true is like tc_strcasecmp, false is like strcmp
    * @return - true or false
    */
    extern logical GUTIL_is_begin_str( const char *text, const char *b_str, logical iscase );

    /**
    * Convert time to date 
    * @param time <I>
    * @param date <O>
    */
    extern void GUTIL_time_to_date( time_t time, date_t *date );

#ifdef __cplusplus
    }
#endif


#endif
